import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-04-26
 * Time: 18:32
 */

public class Main {
    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        System.out.println("请输入一个数");
//        int n = sc.nextInt();
//        int count = 0;
//        for (int i = 0; i < 32; i++) {
//
//            if (((n>>>i) & 1) == 1) {
//                count++;
//            }
//        }
//        System.out.println(count);

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数");
        int n = sc.nextInt();
        int count = 0;
        while (n != 0) {
            n = n & (n-1);
            count++;
        }
        System.out.println(count);

    }

}
